<template>
  <div id="chart">
    <el-card shadow="always">
      <!-- card body -->
      <div id="rose">
        <div id="roseExpression" class="rose"></div>
        <div id="roseAttitude" class="rose"></div>
      </div>
    </el-card>
  </div>
</template>

<script>
export default {
  data() {
    return {}
  },
  methods: {
    getRoseExpression() {
      const roseExpression = echarts.init(
        document.getElementById('roseExpression')
      )
      const optionRoseExp = {
        title: {
          text: 'Nightingale Chart',
          subtext: 'Fake Data',
          left: 'center'
        },
        tooltip: {
          trigger: 'item',
          formatter: '{a} <br/>{b} : {c} ({d}%)'
        },
        legend: {
          //   left: 'center',
          top: 'bottom'
          //   data: ['Area Mode']
        },
        toolbox: {
          show: true,
          feature: {
            mark: { show: true },
            dataView: { show: true, readOnly: false },
            restore: { show: true },
            saveAsImage: { show: true }
          }
        },
        series: [
          {
            name: 'Area Mode',
            type: 'pie',
            radius: [20, 200],
            center: ['50%', '50%'],
            roseType: 'area',
            itemStyle: {
              borderRadius: 8
            },
            data: [
              { value: 30, name: 'rose 1' },
              { value: 28, name: 'rose 2' },
              { value: 26, name: 'rose 3' },
              { value: 24, name: 'rose 4' },
              { value: 22, name: 'rose 5' },
              { value: 20, name: 'rose 6' },
              { value: 18, name: 'rose 7' },
              { value: 16, name: 'rose 8' }
            ]
          }
        ]
      }
      roseExpression.setOption(optionRoseExp)
    },
    getRoseAttitude() {}
  },
  mounted() {
    this.getRoseExpression()
    this.getRoseAttitude()
  }
}
</script>

<style lang="less" scoped>
.el-card {
  margin-top: 30px;
  #rose {
    display: flex;
    justify-content: space-around;
    .rose {
      height: 600px;
      width: 600px;
    }
  }
}
</style>
